#include<bits/stdc++.h>
#define LL long long
#define SZ(x) ((LL)(x.size()))
#define all(x) (x).begin(),(x).end()
using namespace std;
inline LL read(){
  LL q=0,w=1;char ch=getchar();
  while(ch>'9' || ch<'0'){if(ch=='-')w=-1;ch=getchar();}
  while(ch>='0'&&ch<='9'){q=q*10+(ch-'0');ch=getchar();}
  return q*w;
}
void write(LL x){
  if(x<0){putchar('-');x=(-x);}
  if(x>9)write(x/10);
  putchar('0'+x%10);
}
inline void writeln(LL x){write(x);puts("");}
inline void writecs(LL x){write(x);putchar(' ');}

namespace RandHelper{
#define ull unsigned long long
  ull seed=19260817ull;
  inline void Get(){seed^=(seed<<7);seed^=(seed>>11);seed^=(seed<<13);}
  inline ull Rand(){Get();return (seed^(seed<<32ull));}
}using RandHelper::Rand;
inline LL random(LL a,LL b){return (Rand()%(b-a+1)+a);}

#define pb push_back

inline void lsh(vector<LL>&vc){
  sort(all(vc));
  vc.erase(unique(all(vc)),vc.end());
  return ;
}

const LL N = 1000000+95 , lim = 30 , dx[10] = {1,-1,0,0} , dy[10] = {0,0,1,-1} ;
LL n,a[N],b[lim+2][lim+2];bitset<(lim+2)>f[N][lim+2];bitset<(lim+2)>tr[5][lim+2];char str[N];

inline bool check(LL x,LL y){return (1<=x&&x<=lim&&1<=y&&y<=lim);}
inline LL cmp(vector<LL>A,vector<LL>B){//A>B
  for(LL i=0;i<3;i++)if(A[i]!=B[i])return ((A>B)?(1):(-1));
  return 0;
}

#define PL pair<LL,LL>
#define mp make_pair
#define fir first
#define sec second

inline LL tr1(char ch){
  if(ch=='R')return 1;
  if(ch=='G')return 2;
  if(ch=='B')return 3;
  assert(0);return -1;
}
inline char tr2(LL op){
  if(op==1)return 'R';
  if(op==2)return 'G';
  if(op==3)return 'B';
  assert(0);return -1;
}

const char oper[10] = {'D','U','R','L'};
		       
int main(){
  freopen("snake.in","r",stdin);
  freopen("snake.out","w",stdout);
  scanf("%s",str+1);n=strlen(str+1);
  for(LL i=1;i<=n;i++)a[i]=tr1(str[i]);
  for(LL i=1;i<=lim;i++)
    for(LL j=1;j<=lim;j++)b[i][j]=random(1,3);
  vector<LL>now(3);
  auto touch=[&](LL x,LL y,LL w){
	       if(!check(x,y))return ;
	       vector<LL>vc;
	       for(LL i=0;i<4;i++){LL _x=x+dx[i],_y=y+dy[i];if(check(_x,_y)){vc.pb(b[_x][_y]);}}
	       lsh(vc);now[3-SZ(vc)]+=w;return ;
	     };
  auto change=[&](LL x,LL y,LL w){
		touch(x,y,w);
		for(LL i=0;i<4;i++){LL _x=x+dx[i],_y=y+dy[i];if(check(_x,_y)){touch(_x,_y,w);}}
		return ;
	      };
  for(LL TC=1;TC<=300;TC++){
    for(LL x=1;x<=lim;x++)
      for(LL y=1;y<=lim;y++){
	LL u=b[x][y];LL v=random(1,3);while(u==v)v=random(1,3);
	vector<LL>A=now;
	change(x,y,-1);b[x][y]=v;change(x,y,1);
	vector<LL>B=now;LL c=cmp(A,B);
	if(c==1){change(x,y,-1);b[x][y]=u;change(x,y,1);}
	else if(c==0&&(random(0,1)==0)){change(x,y,-1);b[x][y]=u;change(x,y,1);}
      }
  }
  //  cerr<<" clock() = "<<clock()<<endl;
  for(LL i=1;i<=lim;i++)
    for(LL j=1;j<=lim;j++){
      tr[b[i][j]][i][j]=1;
      f[1][i][j]=((b[i][j]==a[1])?(1):(0));
    }
  for(LL t=2;t<=n;t++){
    for(LL i=1;i<=lim;i++){
      f[t][i]=((f[t-1][i]>>1)|(f[t-1][i]<<1));
      if(i>1)f[t][i]=(f[t][i]|f[t-1][i-1]);
      if(i<lim)f[t][i]=(f[t][i]|f[t-1][i+1]);
      f[t][i]=(f[t][i]&tr[a[t]][i]);
    }
  }
  //  cerr<<" clock() = "<<clock()<<endl;
  /*  for(LL i=1;i<=lim;i++){
    for(LL j=1;j<=lim;j++)cout<<f[n][i][j]<<" ";
    cout<<endl;
  }*/
  vector<PL>ans;LL x=-1,y=-1;
  for(LL i=1;i<=lim&&(x==-1);i++)
    for(LL j=1;j<=lim;j++)if(f[n][i][j]){x=i;y=j;break;}
  assert(x!=-1);LL TC=n;
  while(TC>1){
    //    cout<<"> x = "<<x<<" y = "<<y<<endl;
    ans.pb(mp(x,y));TC--;
    for(LL i=0;i<4;i++){
      LL _x=x+dx[i],_y=y+dy[i];
      if(check(_x,_y)&&f[TC][_x][_y]){x=_x;y=_y;break;}
    }
  }
  ans.pb(mp(x,y));
  reverse(all(ans));
  writecs(lim);writeln(lim);
  for(LL x=1;x<=lim;x++){
    for(LL y=1;y<=lim;y++)putchar(tr2(b[x][y]));
    puts("");
  }
  writecs(ans[0].fir);writeln(ans[0].sec);
  for(LL t=1;t<n;t++){
    LL op=-1;
    for(LL i=0;i<4;i++)
      if(ans[t-1].fir+dx[i]==ans[t].fir&&ans[t-1].sec+dy[i]==ans[t].sec){op=i;break;}
    assert(op!=-1);
    putchar(oper[op]);
  }
  puts("");
  return 0;
}
